Developer Documentation

QuickTime 4 API Documentation

Inside Macintosh: QuickTime

Previous | Overview | Contents | Next |

Modal-Dialog Filter Functions

The CustomGetFilePreview routine presents an Open dialog box to the user and allows the user to view file previews. This function differs from StandardGetFilePreview in that you can provide a custom dialog template and functions to support your template. This function corresponds to the existing CustomGetFile routine.

You specify your modal-dialog filter function in the filterProc parameter. Your modal-dialog filter function gives you greater control over the interface presented to the user. See Inside Macintosh: Files for more information about using modal-dialog filter functions with CustomGetFile .

Note
A modal-dialog filter function controls events closer to their source by filtering the events received from the Event Manager. The Standard File Package itself contains an internal modal-dialog filter function that maps keypresses and other user input onto the equivalent dialog box items. If you also want to process events at this level, you can supply your own filter function.

MyModalFilter

A modal-dialog filter function whose address is passed to CustomGetFilePreview should have the following form:

pascal Boolean MyModalFilter (DialogPtr theDialog,
                                         EventRecord *theEvent,
                                         short itemHit, Ptr myDataPtr);
theDialog
A pointer to the dialog structure of the dialog box.

theEvent
A pointer to the event structure for the event.

itemHit
The number of the item selected.

myDataPtr
A pointer to the optional data whose address is passed to CustomGetFilePreview .

DESCRIPTION

Your modal-dialog filter function determines how the Dialog Manager's ModalDialog routine filters events. The ModalDialog routine retrieves events by calling the Event Manager's GetNextEvent routine. The Standard File Package contains an internal filter function that performs some preliminary processing on each event it receives. If you provide a modal-dialog filter function, ModalDialog calls your filter function after it calls the internal Standard File Package filter function and before it sends the event to your dialog hook function.

Your modal-dialog filter function returns a Boolean value that reports whether it handled the event. If your function returns a value of false , ModalDialog processes the event through its own filters. If your function returns a value of true , ModalDialog returns with no further action.

SEE ALSO

See Inside Macintosh: Files for another sample modal-dialog filter function.


© 1999 Apple Computer, Inc.

Previous | Overview | Contents | Next